Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SYN-4078: add createdBy and updatedBy to /tests responses #26

Merged
merged 1 commit into from
Aug 7, 2024

Conversation

bchhay-splunk
Copy link
Collaborator

@bchhay-splunk bchhay-splunk commented Aug 5, 2024

Resolves https://splunk.atlassian.net/browse/SYN-4078


Before the change?

  • createdBy and updatedBy were not part of the /tests endpoint response

After the change?

  • add these fields createdBy and updatedBy to the /tests endpoint response

Pull request checklist

  • Acceptance Tests have been updated, run (make testacc), and pasted in this PR (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)

Acceptance Test Output

➜  syntheticsclient git:(SYN-4078) make testacc
==> Cleaning out old builds 
go clean
rm -rf coverage.txt .sonar .scannerwork
==> Fixing source code with gofmt 
gofmt -s -w .
==> Checking source code against linters 
==> Running all tests
go test ./syntheticsclientv2/... -v -tags=unit_tests -timeout=30s -parallel=8 -cover -coverprofile coverage.txt
=== RUN   TestCreateApiCheckV2
2024/08/07 10:36:53 Client instantiated: http://127.0.0.1:54237
************
POST /tests/api HTTP/1.1
Host: 127.0.0.1:54237
User-Agent: Go-http-client/1.1
Content-Length: 720
Accept: application/json
Content-Type: application/json
X-Sf-Token: apiKey
Accept-Encoding: gzip

{"test":{"active":true,"deviceId":0,"frequency":5,"locationIds":null,"name":"boop-test","requests":[{"configuration":{"body":"","headers":{"X-SF-TOKEN":"jinglebellsbatmanshells","beep":"boop"},"name":"Get-Test","requestMethod":"GET","url":"https://api.us1.signalfx.com/v2/synthetics/tests/api/489"},"setup":[{"extractor":"$.requests","name":"Extract from response body","source":"{{response.body}}","type":"extract_json","variable":"custom-varz"}],"validations":[{"actual":"{{response.code}}","comparator":"equals","expected":"200","name":"Assert response code equals 200","type":"assert_numeric"}]}],"schedulingStrategy":"","customProperties":[{"key":"Test_Key","value":"Test Custom Properties"}],"automaticRetries":1}}
************
&{{true 0001-01-01 00:00:00 +0000 UTC {0   { 0 0 0 0} 0 0} 5 0 [] boop-test [{{ map[X-SF-TOKEN:jinglebellsbatmanshells beep:boop] Get-Test GET https://api.us1.signalfx.com/v2/synthetics/tests/api/489} [{$.requests Extract from response body {{response.body}} extract_json custom-varz  }] [{{{response.code}} equals 200  Assert response code equals 200  assert_numeric   }]}]   0001-01-01 00:00:00 +0000 UTC [{Test_Key Test Custom Properties}]  0001-01-01 00:00:00 +0000 UTC 1  }}
--- PASS: TestCreateApiCheckV2 (0.00s)
=== RUN   TestCreateBrowserCheckV2
2024/08/07 10:36:53 Client instantiated: http://127.0.0.1:54239
************
POST /tests/browser HTTP/1.1
Host: 127.0.0.1:54239
User-Agent: Go-http-client/1.1
Content-Length: 2592
Accept: application/json
Content-Type: application/json
X-Sf-Token: apiKey
Accept-Encoding: gzip

{"test":{"name":"browser-beep-test","transactions":[{"name":"Synthetic transaction 1","steps":[{"name":"Go to URL","type":"go_to_url","url":"https://splunk.com","action":"go_to_url","waitForNav":false,"waitForNavTimeout":0,"maxWaitTime":0,"options":{"url":"https://splunk.com"}},{"name":"click","type":"click_element","waitForNav":true,"waitForNavTimeout":2000,"maxWaitTime":0,"selectorType":"id","selector":"clicky","options":{}},{"name":"fill in fieldz","type":"enter_value","waitForNav":false,"waitForNavTimeout":50,"maxWaitTime":0,"selectorType":"id","selector":"beep","value":"{{env.beep-var}}","options":{}},{"name":"accept---Alert","type":"accept_alert","waitForNav":false,"waitForNavTimeout":0,"maxWaitTime":0,"options":{}},{"name":"Select-Val-Index","type":"select_option","waitForNav":false,"waitForNavTimeout":50,"maxWaitTime":0,"selectorType":"id","selector":"selectionz","optionSelectorType":"index","optionSelector":"{{env.beep-var}}","options":{}},{"name":"Select-val-text","type":"select_option","waitForNav":false,"waitForNavTimeout":50,"maxWaitTime":0,"selectorType":"id","selector":"textzz","optionSelectorType":"text","optionSelector":"sdad","options":{}},{"name":"Select-Val-Val","type":"select_option","waitForNav":false,"waitForNavTimeout":50,"maxWaitTime":0,"selectorType":"id","selector":"valz","optionSelectorType":"value","optionSelector":"{{env.beep-var}}","options":{}},{"name":"Run JS","type":"run_javascript","waitForNav":true,"waitForNavTimeout":2000,"maxWaitTime":0,"value":"beeeeeeep","options":{}},{"name":"Save as text","type":"store_variable_from_element","waitForNav":false,"waitForNavTimeout":0,"maxWaitTime":0,"selectorType":"link","selector":"beepval","variableName":"{{env.terraform-test-foo-301}}","options":{}},{"name":"Save JS return Val","type":"store_variable_from_javascript","waitForNav":true,"waitForNavTimeout":2000,"maxWaitTime":0,"variableName":"{{env.terraform-test-foo-301}}","value":"sdasds","options":{}}]}],"urlProtocol":"https://","startUrl":"www.splunk.com","locationIds":["aws-us-east-1"],"deviceId":1,"frequency":5,"schedulingStrategy":"round_robin","active":true,"advancedSettings":{"authentication":{"password":"{{env.beep-var}}","username":"boopuser"},"cookies":[{"key":"super","value":"duper","domain":"www.batmansagent.com","path":"/boom/goes/beep"}],"headers":[{"name":"batman","value":"Agentoz","domain":"www.batmansagent.com"}],"hostOverrides":null,"userAgent":null,"collectInteractiveMetrics":false,"verifyCertificates":true},"customProperties":[{"key":"Test_Key","value":"Test Custom Properties"}],"automaticRetries":1}}
************
&{{true {0xc0000aa260 [{super duper www.batmansagent.com /boom/goes/beep}] [{batman Agentoz www.batmansagent.com}] [] <nil> false true} 0001-01-01 00:00:00 +0000 UTC {0   { 0 0 0 0} 0 0} 5 0 [aws-us-east-1] browser-beep-test round_robin [{Synthetic transaction 1 [{Go to URL go_to_url https://splunk.com go_to_url false 0 0       {https://splunk.com} 0} {click click_element   true 2000 0 id clicky     {} 0} {fill in fieldz enter_value   false 50 0 id beep    {{env.beep-var}} {} 0} {accept---Alert accept_alert   false 0 0       {} 0} {Select-Val-Index select_option   false 50 0 id selectionz index {{env.beep-var}}   {} 0} {Select-val-text select_option   false 50 0 id textzz text sdad   {} 0} {Select-Val-Val select_option   false 50 0 id valz value {{env.beep-var}}   {} 0} {Run JS run_javascript   true 2000 0      beeeeeeep {} 0} {Save as text store_variable_from_element   false 0 0 link beepval   {{env.terraform-test-foo-301}}  {} 0} {Save JS return Val store_variable_from_javascript   true 2000 0     {{env.terraform-test-foo-301}} sdasds {} 0}]}]  0001-01-01 00:00:00 +0000 UTC [{Test_Key Test Custom Properties}]  0001-01-01 00:00:00 +0000 UTC 1  }}
--- PASS: TestCreateBrowserCheckV2 (0.00s)
=== RUN   TestCreateDowntimeConfigurationV2
2024/08/07 10:36:53 Client instantiated: http://127.0.0.1:54241
************
POST /downtime_configurations HTTP/1.1
Host: 127.0.0.1:54241
User-Agent: Go-http-client/1.1
Content-Length: 320
Accept: application/json
Content-Type: application/json
X-Sf-Token: apiKey
Accept-Encoding: gzip

{"downtimeConfiguration":{"createdAt":"0001-01-01T00:00:00Z","description":"My super awesome test downtimeConfiguration","name":"dc test","updatedAt":"0001-01-01T00:00:00Z","rule":"augment_data","startTime":"2024-05-16T20:23:00Z","endTime":"2024-05-16T20:38:00Z","testsUpdatedAt":"0001-01-01T00:00:00Z","testIds":[482]}}
************
&{{0001-01-01 00:00:00 +0000 UTC My super awesome test downtimeConfiguration 0 dc test 0001-01-01 00:00:00 +0000 UTC augment_data 2024-05-16 20:23:00 +0000 UTC 2024-05-16 20:38:00 +0000 UTC  0001-01-01 00:00:00 +0000 UTC 0 [482]}}
--- PASS: TestCreateDowntimeConfigurationV2 (0.00s)
=== RUN   TestCreateHttpCheckV2
2024/08/07 10:36:53 Client instantiated: http://127.0.0.1:54243
************
POST /tests/http HTTP/1.1
Host: 127.0.0.1:54243
User-Agent: Go-http-client/1.1
Content-Length: 401
Accept: application/json
Content-Type: application/json
X-Sf-Token: apiKey
Accept-Encoding: gzip

{"test":{"name":"morebeeps-test","type":"http","url":"https://www.splunk.com","locationIds":null,"frequency":10,"schedulingStrategy":"","active":true,"requestMethod":"","authentication":null,"userAgent":null,"verifyCertificates":false,"headers":[{"name":"boop","value":"beep"}],"validations":[],"customProperties":[{"key":"Test_Key","value":"Test Custom Properties"}],"automaticRetries":1,"port":443}}
************
&{{0 morebeeps-test true 10  0001-01-01 00:00:00 +0000 UTC 0001-01-01 00:00:00 +0000 UTC [] http https://www.splunk.com   <nil> <nil> false [{boop beep}] [] [{Test_Key Test Custom Properties}]  0001-01-01 00:00:00 +0000 UTC 1 443  }}
--- PASS: TestCreateHttpCheckV2 (0.00s)
=== RUN   TestCreateLocationV2
2024/08/07 10:36:53 Client instantiated: http://127.0.0.1:54245
************
POST /locations HTTP/1.1
Host: 127.0.0.1:54245
User-Agent: Go-http-client/1.1
Content-Length: 79
Accept: application/json
Content-Type: application/json
X-Sf-Token: apiKey
Accept-Encoding: gzip

{"location":{"id":"private-data-center","label":"Data Center","default":false}}
************
&{{private-data-center Data Center false  } {[] []}}
--- PASS: TestCreateLocationV2 (0.00s)
=== RUN   TestCreatePortCheckV2
2024/08/07 10:36:53 Client instantiated: http://127.0.0.1:54247
************
POST /tests/port HTTP/1.1
Host: 127.0.0.1:54247
User-Agent: Go-http-client/1.1
Content-Length: 278
Accept: application/json
Content-Type: application/json
X-Sf-Token: apiKey
Accept-Encoding: gzip

{"test":{"name":"splunk - port 443","type":"port","url":"","port":443,"protocol":"tcp","host":"www.splunk.com","locationIds":null,"frequency":10,"schedulingStrategy":"","active":true,"customProperties":[{"key":"Test_Key","value":"Test Custom Properties"}],"automaticRetries":1}}
************
&{{0 splunk - port 443 true 10  0001-01-01 00:00:00 +0000 UTC 0001-01-01 00:00:00 +0000 UTC [] port tcp www.splunk.com 443 [{Test_Key Test Custom Properties}]  0001-01-01 00:00:00 +0000 UTC 1  }}
--- PASS: TestCreatePortCheckV2 (0.00s)
=== RUN   TestCreateVariableV2
2024/08/07 10:36:53 Client instantiated: http://127.0.0.1:54249
************
POST /variables HTTP/1.1
Host: 127.0.0.1:54249
User-Agent: Go-http-client/1.1
Content-Length: 174
Accept: application/json
Content-Type: application/json
X-Sf-Token: apiKey
Accept-Encoding: gzip

{"variable":{"createdAt":"0001-01-01T00:00:00Z","description":"My super awesome test variable","name":"food","secret":false,"updatedAt":"0001-01-01T00:00:00Z","value":"bar"}}
************
&{{0001-01-01 00:00:00 +0000 UTC My super awesome test variable 0 food false 0001-01-01 00:00:00 +0000 UTC bar}}
--- PASS: TestCreateVariableV2 (0.00s)
=== RUN   TestDeleteApiCheckV2
2024/08/07 10:36:53 Client instantiated: http://127.0.0.1:54251
************
DELETE /tests/api/19 HTTP/1.1
Host: 127.0.0.1:54251
User-Agent: Go-http-client/1.1
Content-Length: 2
Accept: application/json
Content-Type: application/json
X-Sf-Token: apiKey
Accept-Encoding: gzip

{}
************
200
200
--- PASS: TestDeleteApiCheckV2 (0.00s)
=== RUN   TestDeleteBrowserCheckV2
2024/08/07 10:36:53 Client instantiated: http://127.0.0.1:54253
************
DELETE /tests/browser/19 HTTP/1.1
Host: 127.0.0.1:54253
User-Agent: Go-http-client/1.1
Content-Length: 2
Accept: application/json
Content-Type: application/json
X-Sf-Token: apiKey
Accept-Encoding: gzip

{}
************
200
200
--- PASS: TestDeleteBrowserCheckV2 (0.00s)
=== RUN   TestDeleteDowntimeConfigurationV2
2024/08/07 10:36:53 Client instantiated: http://127.0.0.1:54255
************
DELETE /downtime_configurations/19 HTTP/1.1
Host: 127.0.0.1:54255
User-Agent: Go-http-client/1.1
Content-Length: 2
Accept: application/json
Content-Type: application/json
X-Sf-Token: apiKey
Accept-Encoding: gzip

{}
************
200
200
--- PASS: TestDeleteDowntimeConfigurationV2 (0.00s)
=== RUN   TestDeleteHttpCheckV2
2024/08/07 10:36:53 Client instantiated: http://127.0.0.1:54257
************
DELETE /tests/http/19 HTTP/1.1
Host: 127.0.0.1:54257
User-Agent: Go-http-client/1.1
Content-Length: 2
Accept: application/json
Content-Type: application/json
X-Sf-Token: apiKey
Accept-Encoding: gzip

{}
************
200
200
--- PASS: TestDeleteHttpCheckV2 (0.00s)
=== RUN   TestDeleteLocationV2
2024/08/07 10:36:53 Client instantiated: http://127.0.0.1:54259
************
DELETE /locations/beep HTTP/1.1
Host: 127.0.0.1:54259
User-Agent: Go-http-client/1.1
Content-Length: 2
Accept: application/json
Content-Type: application/json
X-Sf-Token: apiKey
Accept-Encoding: gzip

{}
************
200
200
--- PASS: TestDeleteLocationV2 (0.00s)
=== RUN   TestDeletePortCheckV2
2024/08/07 10:36:53 Client instantiated: http://127.0.0.1:54261
************
DELETE /tests/port/19 HTTP/1.1
Host: 127.0.0.1:54261
User-Agent: Go-http-client/1.1
Content-Length: 2
Accept: application/json
Content-Type: application/json
X-Sf-Token: apiKey
Accept-Encoding: gzip

{}
************
200
200
--- PASS: TestDeletePortCheckV2 (0.00s)
=== RUN   TestDeleteVariableV2
2024/08/07 10:36:53 Client instantiated: http://127.0.0.1:54263
************
DELETE /variables/19 HTTP/1.1
Host: 127.0.0.1:54263
User-Agent: Go-http-client/1.1
Content-Length: 2
Accept: application/json
Content-Type: application/json
X-Sf-Token: apiKey
Accept-Encoding: gzip

{}
************
200
200
--- PASS: TestDeleteVariableV2 (0.00s)
=== RUN   TestGetApiCheckV2
2024/08/07 10:36:53 Client instantiated: http://127.0.0.1:54265
************
GET /tests/api/489 HTTP/1.1
Host: 127.0.0.1:54265
User-Agent: Go-http-client/1.1
Content-Length: 2
Accept: application/json
Content-Type: application/json
X-Sf-Token: apiKey
Accept-Encoding: gzip

{}
************
--- PASS: TestGetApiCheckV2 (0.00s)
=== RUN   TestGetBrowserCheckV2
2024/08/07 10:36:53 Client instantiated: http://127.0.0.1:54267
************
GET /tests/browser/1 HTTP/1.1
Host: 127.0.0.1:54267
User-Agent: Go-http-client/1.1
Content-Length: 2
Accept: application/json
Content-Type: application/json
X-Sf-Token: apiKey
Accept-Encoding: gzip

{}
************
--- PASS: TestGetBrowserCheckV2 (0.00s)
=== RUN   TestGetChecksV2
2024/08/07 10:36:53 Client instantiated: http://127.0.0.1:54269
************
GET /tests?orderBy=id&page=1&perPage=50&schedulingStrategy=&search=&testType= HTTP/1.1
Host: 127.0.0.1:54269
User-Agent: Go-http-client/1.1
Content-Length: 2
Accept: application/json
Content-Type: application/json
X-Sf-Token: apiKey
Accept-Encoding: gzip

{}
************
--- PASS: TestGetChecksV2 (0.00s)
=== RUN   TestGetDevicesV2
2024/08/07 10:36:53 Client instantiated: http://127.0.0.1:54271
************
GET /devices HTTP/1.1
Host: 127.0.0.1:54271
User-Agent: Go-http-client/1.1
Content-Length: 2
Accept: application/json
Content-Type: application/json
X-Sf-Token: apiKey
Accept-Encoding: gzip

{}
************
--- PASS: TestGetDevicesV2 (0.00s)
=== RUN   TestGetDowntimeConfigurationV2
2024/08/07 10:36:53 Client instantiated: http://127.0.0.1:54273
************
GET /downtime_configurations/1 HTTP/1.1
Host: 127.0.0.1:54273
User-Agent: Go-http-client/1.1
Content-Length: 2
Accept: application/json
Content-Type: application/json
X-Sf-Token: apiKey
Accept-Encoding: gzip

{}
************
--- PASS: TestGetDowntimeConfigurationV2 (0.00s)
=== RUN   TestGetDowntimeConfigurationsV2
2024/08/07 10:36:53 Client instantiated: http://127.0.0.1:54275
************
GET /downtime_configurations?orderBy=&page=1&perPage=50&search= HTTP/1.1
Host: 127.0.0.1:54275
User-Agent: Go-http-client/1.1
Content-Length: 2
Accept: application/json
Content-Type: application/json
X-Sf-Token: apiKey
Accept-Encoding: gzip

{}
************
--- PASS: TestGetDowntimeConfigurationsV2 (0.00s)
=== RUN   TestGetHttpCheckV2
2024/08/07 10:36:53 Client instantiated: http://127.0.0.1:54277
************
GET /tests/http/1 HTTP/1.1
Host: 127.0.0.1:54277
User-Agent: Go-http-client/1.1
Content-Length: 2
Accept: application/json
Content-Type: application/json
X-Sf-Token: apiKey
Accept-Encoding: gzip

{}
************
--- PASS: TestGetHttpCheckV2 (0.00s)
=== RUN   TestGetLocationsV2
2024/08/07 10:36:53 Client instantiated: http://127.0.0.1:54279
************
GET /locations HTTP/1.1
Host: 127.0.0.1:54279
User-Agent: Go-http-client/1.1
Content-Length: 2
Accept: application/json
Content-Type: application/json
X-Sf-Token: apiKey
Accept-Encoding: gzip

{}
************
--- PASS: TestGetLocationsV2 (0.00s)
=== RUN   TestGetLocationV2
2024/08/07 10:36:53 Client instantiated: http://127.0.0.1:54281
************
GET /locations/aws-us-east-1 HTTP/1.1
Host: 127.0.0.1:54281
User-Agent: Go-http-client/1.1
Content-Length: 2
Accept: application/json
Content-Type: application/json
X-Sf-Token: apiKey
Accept-Encoding: gzip

{}
************
--- PASS: TestGetLocationV2 (0.00s)
=== RUN   TestGetPortCheckV2
2024/08/07 10:36:53 Client instantiated: http://127.0.0.1:54283
************
GET /tests/port/1 HTTP/1.1
Host: 127.0.0.1:54283
User-Agent: Go-http-client/1.1
Content-Length: 2
Accept: application/json
Content-Type: application/json
X-Sf-Token: apiKey
Accept-Encoding: gzip

{}
************
--- PASS: TestGetPortCheckV2 (0.00s)
=== RUN   TestGetVariableV2
2024/08/07 10:36:53 Client instantiated: http://127.0.0.1:54285
************
GET /variables/1 HTTP/1.1
Host: 127.0.0.1:54285
User-Agent: Go-http-client/1.1
Content-Length: 2
Accept: application/json
Content-Type: application/json
X-Sf-Token: apiKey
Accept-Encoding: gzip

{}
************
--- PASS: TestGetVariableV2 (0.00s)
=== RUN   TestGetVariablesV2
2024/08/07 10:36:53 Client instantiated: http://127.0.0.1:54287
************
GET /variables HTTP/1.1
Host: 127.0.0.1:54287
User-Agent: Go-http-client/1.1
Content-Length: 2
Accept: application/json
Content-Type: application/json
X-Sf-Token: apiKey
Accept-Encoding: gzip

{}
************
--- PASS: TestGetVariablesV2 (0.00s)
=== RUN   TestConfigurableClient
2024/08/07 10:36:53 Client instantiated: http://127.0.0.1:54289
2024/08/07 10:36:53 Client instantiated: http://127.0.0.1:54290
--- PASS: TestConfigurableClient (0.00s)
=== RUN   TestConfigurableClientTimeout
2024/08/07 10:36:53 Client instantiated: http://127.0.0.1:54291
************
GET /tests/browser/12 HTTP/1.1
Host: 127.0.0.1:54291
User-Agent: Go-http-client/1.1
Content-Length: 2
Accept: application/json
Content-Type: application/json
X-Sf-Token: apiKey
Accept-Encoding: gzip

{}
************
--- PASS: TestConfigurableClientTimeout (1.00s)
=== RUN   TestUpdateApiCheckV2
2024/08/07 10:36:54 Client instantiated: http://127.0.0.1:54293
************
PUT /tests/api/10 HTTP/1.1
Host: 127.0.0.1:54293
User-Agent: Go-http-client/1.1
Content-Length: 720
Accept: application/json
Content-Type: application/json
X-Sf-Token: apiKey
Accept-Encoding: gzip

{"test":{"active":true,"deviceId":0,"frequency":5,"locationIds":null,"name":"boop-test","requests":[{"configuration":{"body":"","headers":{"X-SF-TOKEN":"jinglebellsbatmanshells","beep":"boop"},"name":"Get-Test","requestMethod":"GET","url":"https://api.us1.signalfx.com/v2/synthetics/tests/api/489"},"setup":[{"extractor":"$.requests","name":"Extract from response body","source":"{{response.body}}","type":"extract_json","variable":"custom-varz"}],"validations":[{"actual":"{{response.code}}","comparator":"equals","expected":"200","name":"Assert response code equals 200","type":"assert_numeric"}]}],"schedulingStrategy":"","customProperties":[{"key":"Test_Key","value":"Test Custom Properties"}],"automaticRetries":1}}
************
&{{true 0001-01-01 00:00:00 +0000 UTC {0   { 0 0 0 0} 0 0} 5 0 [] boop-test [{{ map[X-SF-TOKEN:jinglebellsbatmanshells beep:boop] Get-Test GET https://api.us1.signalfx.com/v2/synthetics/tests/api/489} [{$.requests Extract from response body {{response.body}} extract_json custom-varz  }] [{{{response.code}} equals 200  Assert response code equals 200  assert_numeric   }]}]   0001-01-01 00:00:00 +0000 UTC [{Test_Key Test Custom Properties}]  0001-01-01 00:00:00 +0000 UTC 1  }}
--- PASS: TestUpdateApiCheckV2 (0.00s)
=== RUN   TestUpdateBrowserCheckV2
2024/08/07 10:36:54 Client instantiated: http://127.0.0.1:54295
************
PUT /tests/browser/10 HTTP/1.1
Host: 127.0.0.1:54295
User-Agent: Go-http-client/1.1
Content-Length: 2593
Accept: application/json
Content-Type: application/json
X-Sf-Token: apiKey
Accept-Encoding: gzip

{"test":{"name":"browser-beep-test","transactions":[{"name":"Synthetic transaction 1","steps":[{"name":"Go to URL","type":"go_to_url","url":"https://splunk.com","action":"go_to_url","waitForNav":false,"waitForNavTimeout":0,"maxWaitTime":0,"options":{"url":"https://splunk.com"}},{"name":"click","type":"click_element","waitForNav":true,"waitForNavTimeout":2000,"maxWaitTime":0,"selectorType":"id","selector":"clicky","options":{}},{"name":"fill in fieldz","type":"enter_value","waitForNav":false,"waitForNavTimeout":50,"maxWaitTime":0,"selectorType":"id","selector":"beep","value":"{{env.beep-var}}","options":{}},{"name":"accept---Alert","type":"accept_alert","waitForNav":false,"waitForNavTimeout":0,"maxWaitTime":0,"options":{}},{"name":"Select-Val-Index","type":"select_option","waitForNav":false,"waitForNavTimeout":50,"maxWaitTime":0,"selectorType":"id","selector":"selectionz","optionSelectorType":"index","optionSelector":"{{env.beep-var}}","options":{}},{"name":"Select-val-text","type":"select_option","waitForNav":false,"waitForNavTimeout":50,"maxWaitTime":0,"selectorType":"id","selector":"textzz","optionSelectorType":"text","optionSelector":"sdad","options":{}},{"name":"Select-Val-Val","type":"select_option","waitForNav":false,"waitForNavTimeout":50,"maxWaitTime":0,"selectorType":"id","selector":"valz","optionSelectorType":"value","optionSelector":"{{env.beep-var}}","options":{}},{"name":"Run JS","type":"run_javascript","waitForNav":true,"waitForNavTimeout":2000,"maxWaitTime":0,"value":"beeeeeeep","options":{}},{"name":"Save as text","type":"store_variable_from_element","waitForNav":false,"waitForNavTimeout":0,"maxWaitTime":0,"selectorType":"link","selector":"beepval","variableName":"{{env.terraform-test-foo-301}}","options":{}},{"name":"Save JS return Val","type":"store_variable_from_javascript","waitForNav":true,"waitForNavTimeout":2000,"maxWaitTime":0,"variableName":"{{env.terraform-test-foo-301}}","value":"sdasds","options":{}}]}],"urlProtocol":"https://","startUrl":"www.splunk.com","locationIds":["aws-us-east-1"],"deviceId":1,"frequency":15,"schedulingStrategy":"round_robin","active":true,"advancedSettings":{"authentication":{"password":"{{env.beep-var}}","username":"boopuser"},"cookies":[{"key":"super","value":"duper","domain":"www.batmansagent.com","path":"/boom/goes/beep"}],"headers":[{"name":"batman","value":"Agentoz","domain":"www.batmansagent.com"}],"hostOverrides":null,"userAgent":null,"collectInteractiveMetrics":false,"verifyCertificates":true},"customProperties":[{"key":"Test_Key","value":"Test Custom Properties"}],"automaticRetries":1}}
************
&{{true {0xc0000781c0 [{super duper www.batmansagent.com /boom/goes/beep}] [{batman Agentoz www.batmansagent.com}] [] <nil> false true} 0001-01-01 00:00:00 +0000 UTC {0   { 0 0 0 0} 0 0} 15 0 [aws-us-east-1] browser-beep-test round_robin [{Synthetic transaction 1 [{Go to URL go_to_url https://splunk.com go_to_url false 0 0       {https://splunk.com} 0} {click click_element   true 2000 0 id clicky     {} 0} {fill in fieldz enter_value   false 50 0 id beep    {{env.beep-var}} {} 0} {accept---Alert accept_alert   false 0 0       {} 0} {Select-Val-Index select_option   false 50 0 id selectionz index {{env.beep-var}}   {} 0} {Select-val-text select_option   false 50 0 id textzz text sdad   {} 0} {Select-Val-Val select_option   false 50 0 id valz value {{env.beep-var}}   {} 0} {Run JS run_javascript   true 2000 0      beeeeeeep {} 0} {Save as text store_variable_from_element   false 0 0 link beepval   {{env.terraform-test-foo-301}}  {} 0} {Save JS return Val store_variable_from_javascript   true 2000 0     {{env.terraform-test-foo-301}} sdasds {} 0}]}]  0001-01-01 00:00:00 +0000 UTC [{Test_Key Test Custom Properties}]  0001-01-01 00:00:00 +0000 UTC 1  }}
--- PASS: TestUpdateBrowserCheckV2 (0.00s)
=== RUN   TestUpdateDowntimeConfigurationV2
2024/08/07 10:36:54 Client instantiated: http://127.0.0.1:54297
************
PUT /downtime_configurations/10 HTTP/1.1
Host: 127.0.0.1:54297
User-Agent: Go-http-client/1.1
Content-Length: 321
Accept: application/json
Content-Type: application/json
X-Sf-Token: apiKey
Accept-Encoding: gzip

{"downtimeConfiguration":{"createdAt":"0001-01-01T00:00:00Z","description":"My super awesome test downtimeConfiguration","name":"dc test","updatedAt":"0001-01-01T00:00:00Z","rule":"pause_tests","startTime":"2024-05-16T20:23:00Z","endTime":"2024-05-16T20:38:00Z","testsUpdatedAt":"0001-01-01T00:00:00Z","testIds":[29976]}}
************
&{{0001-01-01 00:00:00 +0000 UTC My super awesome test downtimeConfiguration 0 dc test 0001-01-01 00:00:00 +0000 UTC pause_tests 2024-05-16 20:23:00 +0000 UTC 2024-05-16 20:38:00 +0000 UTC  0001-01-01 00:00:00 +0000 UTC 0 [29976]}}
--- PASS: TestUpdateDowntimeConfigurationV2 (0.00s)
=== RUN   TestUpdateHttpCheckV2
2024/08/07 10:36:54 Client instantiated: http://127.0.0.1:54299
************
PUT /tests/http/10 HTTP/1.1
Host: 127.0.0.1:54299
User-Agent: Go-http-client/1.1
Content-Length: 401
Accept: application/json
Content-Type: application/json
X-Sf-Token: apiKey
Accept-Encoding: gzip

{"test":{"name":"morebeeps-test","type":"http","url":"https://www.splunk.com","locationIds":null,"frequency":10,"schedulingStrategy":"","active":true,"requestMethod":"","authentication":null,"userAgent":null,"verifyCertificates":false,"headers":[{"name":"boop","value":"beep"}],"validations":[],"customProperties":[{"key":"Test_Key","value":"Test Custom Properties"}],"automaticRetries":1,"port":443}}
************
&{{0 morebeeps-test true 10  0001-01-01 00:00:00 +0000 UTC 0001-01-01 00:00:00 +0000 UTC [] http https://www.splunk.com   <nil> <nil> false [{boop beep}] [] [{Test_Key Test Custom Properties}]  0001-01-01 00:00:00 +0000 UTC 1 443  }}
--- PASS: TestUpdateHttpCheckV2 (0.00s)
=== RUN   TestUpdatePortCheckV2
2024/08/07 10:36:54 Client instantiated: http://127.0.0.1:54301
************
PUT /tests/port/1650 HTTP/1.1
Host: 127.0.0.1:54301
User-Agent: Go-http-client/1.1
Content-Length: 277
Accept: application/json
Content-Type: application/json
X-Sf-Token: apiKey
Accept-Encoding: gzip

{"test":{"name":"splunk - port 443","type":"port","url":"","port":80,"protocol":"tcp","host":"www.splunk.com","locationIds":null,"frequency":10,"schedulingStrategy":"","active":true,"customProperties":[{"key":"Test_Key","value":"Test Custom Properties"}],"automaticRetries":1}}
************
&{{0 splunk - port 443 true 10  0001-01-01 00:00:00 +0000 UTC 0001-01-01 00:00:00 +0000 UTC [] port tcp www.splunk.com 80 [{Test_Key Test Custom Properties}]  0001-01-01 00:00:00 +0000 UTC 1  }}
--- PASS: TestUpdatePortCheckV2 (0.00s)
=== RUN   TestUpdateVariableV2
2024/08/07 10:36:54 Client instantiated: http://127.0.0.1:54303
************
PUT /variables/10 HTTP/1.1
Host: 127.0.0.1:54303
User-Agent: Go-http-client/1.1
Content-Length: 174
Accept: application/json
Content-Type: application/json
X-Sf-Token: apiKey
Accept-Encoding: gzip

{"variable":{"createdAt":"0001-01-01T00:00:00Z","description":"My super awesome test variable","name":"foo2","secret":false,"updatedAt":"0001-01-01T00:00:00Z","value":"bar"}}
************
&{{0001-01-01 00:00:00 +0000 UTC My super awesome test variable 0 foo2 false 0001-01-01 00:00:00 +0000 UTC bar}}
--- PASS: TestUpdateVariableV2 (0.00s)
PASS
coverage: 70.3% of statements
ok      github.com/splunk/syntheticsclient/v2/syntheticsclientv2        1.522s  coverage: 70.3% of statements

Does this introduce a breaking change?

  • Yes
  • No

Copy link
Collaborator

@greatestusername-splunk greatestusername-splunk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Thanks for updating the tests and providing that test output in the PR!

@bchhay-splunk bchhay-splunk merged commit 7b990b5 into splunk:v2 Aug 7, 2024
3 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Aug 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants